<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>用户列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<%@include file="/skins/jsp/loadCss.jsp"%>
</head>
<body>
	<%@include file="/skins/jsp/loadJquery.jsp"%>
	<h1 class="ch-box-container">用户信息</h1>
	<p class="ch-form-actions" style="float: right;margin-bottom: 5px;">
		<s:a action="findUser" namespace="/system" cssClass="ch-btn ch-btn-small">新增</s:a>
	</p>
	<table class="ch-datagrid-controls">
		<thead>
			<tr>
				<th width="2%" style="text-align: center;"><input type="checkbox" name="mycheckall"/></th>
				<th width="4%" style="text-align: center;">序号</th>
				<th width="15%" style="text-align: center;">用户名</th>
				<th width="15%" style="text-align: center;">登录名</th>
				<th width="15%" style="text-align: center;">用户邮箱</th>
				<th width="10%" style="text-align: center;">用户状态</th>
				<th width="15%" style="text-align: center;">操作</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="userList" status="st">
				<tr <s:if test="#st.isEven()">style="BACKGROUND: #f8f8f8"</s:if>>
					<td align="center"><input type="checkbox" name="mycheck"/></td>
					<td align="center"><s:property value="%{#st.count}" /></td>
					<td><s:property value="userName" />
					</td>
					<td><s:property value="loginName" />
					</td>
					<td align="center"><s:property value="email" />
					</td>
					<td align="center"><s:if test="status=1">
							正常用户
						</s:if></td>
					<td><s:a action="findUser" namespace="/system"
							cssClass="ch-btn ch-btn-small">
							<s:param name="userId" value="userId"></s:param>修改</s:a> 
							<button class="ch-btn ch-btn-small" onclick="delUserS('<s:property value="userId" />')">删除</button>
							<button class="ch-btn ch-btn-small" onclick="initCue('<s:property value="userId" />')">初始密码</button>
					</td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<script type="text/javascript">
		var delUserS=function(userId){if(confirm("是否要删除此条记录！")){delUser(userId)}},delUser = function(userId){window.location.href="<%=request.getContextPath()%>/system/delUserInfo.action?userId="+userId},
		initCue = function(userId){if(confirm("确定要初始此用户密码？"))initPassWord(userId)},initPassWord = function(userId){window.location.href="<%=request.getContextPath()%>/system/initPassWord.action?userId="+userId};
	</script>
</body>
</html>